<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="https://unpkg.com/swiper/swiper-bundle.min.css">    
  <style>
    .mySwiper{
      width: 800px;
      height: 600px;
      margin: 20px auto;
    }
    .swiper-slide{
      width: 800px;
      height: 600px;
      background-color: #ae6969;
    }
    .swiper-slide:nth-child(2n){
      background-color: #a1d625;
    }
  </style>
</head>
<body>
  <div id="app">
   
    <home-page></home-page>
  </div>
  <script src="./vue.global.js"></script>
  <script src="./axios.js"></script>
  <script src="https://unpkg.com/swiper/swiper-bundle.js"> </script>  
  <script>
    const { createApp } = Vue;
    const app = createApp({
    });
    const HomePage = {
      template: `
        <div>
          <div class="swiper mySwiper">
            <div class="swiper-wrapper">
              <div class="swiper-slide">slider1</div>
              <div class="swiper-slide">slider2</div>
              <div class="swiper-slide">slider3</div>
            </div>
          </div>
        </div>
      `,
      
      data() {
        return {
          swiper: null
        }
      },
      methods: {
        initSwiper(){
         this.swiper = new Swiper('.mySwiper', {
            autoplay: true,//可选选项，自动滑动
            loop: true
          })
        }
      },
      created () {
        
      },
      mounted(){
        this.initSwiper()
      }
    }

    app.component('HomePage', HomePage)
    app.mount('#app')
  </script>
</body>
</html>